/* ================================================================================================

hrn.cpp

author: Antoine Allard
affil.: Universite Laval, Quebec City, Quebec
www:    dynamica.phy.ulaval.ca


last modif. August 27, 2013

// ==============================================================================================*/

#include "hrn.hpp"

int main(int argc, char* argv[])
{

  // puts arguments into appropriate variables
  int cnt_input = 0;
  string K_mat_filename = argv[++cnt_input];
  string C_mat_filename = argv[++cnt_input];
  double T = atof(argv[++cnt_input]);
  string output_filename = argv[++cnt_input];

  // defines the distribution objects
  degree_distribution P(K_mat_filename);
  transition_probabilities R(P,C_mat_filename);

  // computes the size of the giant component
  double S = compute_S(T,P,R);

  // appends the size of the giant component to the output file
  ofstream output_file(output_filename.c_str(), ios_base::app);
  output_file.precision(6);
  output_file<<fixed<<T<<"  "<<fixed<<S<<endl;
  output_file.close();

}
